<template>
  <el-menu :default-openeds="['1', '3']" style="min-height: 100%; overflow-x: hidden;"
           background-color="rgb(48,65,86)"
           text-color="#fff"
           active-text-color="#ffd04b"
           :collapse-transition="false"
           :collapse="isCollapse"
           router

  >
    <div style="height:65px; line-height:65px; text-align: center; ">
      <img src="../assets/newLogo/cloud-logo.png" alt="" style="width: 85px;height: 65px; position:absolute; left:-5px; top: 5px;">
      <b style="color: white; font-size: 17px; position:absolute; left: 85px;" v-show="logoTextShow">后台管理系统</b>
    </div>
    <div v-for="item in menus" :key="item.id">
        <div v-if="item.path">
          <el-menu-item :index="item.path" >
            <i :class="item.icon"></i>
            <span slot="title">{{ item.name }}</span>
          </el-menu-item>
        </div>
        <div v-else>
          <el-submenu :index="item.path">
            <template slot="title">
              <i :class="item.icon"></i>
              <span slot="title">{{ item.name }}</span>
            </template>
            <div v-for="childrenItem in item.children" :key="childrenItem.id">
              <div v-if="childrenItem.path">
                <el-menu-item :index="childrenItem.path" >
                  <i :class="childrenItem.icon"></i>
                  <span slot="title">{{ childrenItem.name }}</span>
                </el-menu-item>
              </div>
            </div>
          </el-submenu>
        </div>
    </div>
  </el-menu>
</template>

<script>
export default {
  name: "Aside",
  props:{
    isCollapse: Boolean,
    logoTextShow: Boolean,
    menus: Array
  },

}
</script>

<style >
.el-menu--collapse  .el-submenu__title span{
  display: none;
}

.el-menu--collapse  .el-submenu__title .el-submenu__icon-arrow{
  display: none;
}


</style>